﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using GalaSoft.MvvmLight.Messaging;

namespace AgileLogistics.View.Meishi
{
    /// <summary>
    /// Page_Meishi.xaml 的交互逻辑
    /// </summary>
    public partial class Page_Meishi : Page
    {

        Model.DBContext dbContext = new Model.DBContext();

        public Page_Meishi()
        {
            InitializeComponent();

            Messenger.Default.Register<Page>(this, "MenuChangePage", ChangeMenu);



            var CurrRole = dbContext.DB.Queryable<Model.Roles>().Where(r => r.Id == Comm.Temp.LoginUser.RoleId).First() ;
            //验证权限
            if (!CurrRole.FuncMenu)
            {
                menu_TouPiaoGuanli.Visibility = Visibility.Collapsed;
                menu_MenuGuanli.Visibility = Visibility.Collapsed;
            }
        }

        private void ChangeMenu(Page page)
        {
            Frm.Navigate(page);
        }



    }
}
